<template>
  <view>
    <view class="content" v-for="(item, index) in list" :key="index">
      <!-- 头像 -->
      <view class="avatar">
        <!-- <image
        class="zanImg"
        src="https://cdn.uviewui.com/uview/album/1.jpg"
      ></image> -->
        <u-avatar class="zanImg" :src="item.user.avatar_url" @click="toHome(item.user.user_id)"></u-avatar>
      </view>
      <view class="avatarRight">
        <!-- 昵称，时间 -->
        <view class="nickTime">
          <view class="nick">
            {{ item.user.nick_name }}
            <view class="laoshi" v-if="item.user.is_teacher">老师</view>
            <view class="daoshi" v-if="item.user.is_senators">导师</view>
          </view>
          <view class="time">{{ item.create_time }}</view>
        </view>
        <!-- 内容 -->
        <view class="detail">{{ item.content }}</view></view
      >
    </view>
  </view>
</template>
<script>
export default {
  props: {
    list: {
      type: Array,
      default: () => [],
    },
  },
  methods:{
    toHome(user_id) {
      // console.log(item,'555555555')
      uni.navigateTo({
        url: `/pages/home/home?user_id=${user_id}`,
      });
    },
  }
};
</script>
<style scoped lang="scss">
.content {
  margin-top: 27rpx;
  display: flex;
  .avatar {
    width: 72rpx;
    height: 72rpx;
    .zanImg {
      border-radius: 36rpx;
      width: 72rpx;
      height: 72rpx;
    }
  }
  .avatarRight {
    width: 100%;

    padding-left: 16rpx;
    .nickTime {
      display: flex;
      justify-content: space-between;
      line-height: 36rpx;
      .nick {
        font-size: 24rpx;
        font-family: PingFang SC-Medium, PingFang SC;
        font-weight: 400;
        color: #adadad;
        display: flex;
        align-items: center;
        .nick_otner {
          margin: 0 10rpx;
        }
        .laoshi {
          font-size: 24rpx;
          background: #ffe9ce;
          color: #ffbb69;
          padding: 2rpx 12rpx;
          margin: 0 10rpx;
          box-sizing: border-box;
        }
        .daoshi {
          font-size: 24rpx;
          background: #efe0ff;
          color: #cda1ff;
          padding: 2rpx 12rpx;
          margin: 0 10rpx;
          box-sizing: border-box;
        }
      }
      .time {
        font-size: 24rpx;
        font-family: PingFang SC-Medium, PingFang SC;
        font-weight: 400;
        color: #adadad;
      }
    }
    .detail {
      line-height: 42rpx;
      font-size: 28rpx;
      font-family: PingFang SC-Medium, PingFang SC;
      font-weight: 400;
      color: #eeeeee;
    }
  }
}
</style>